<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>修改记录</title>
    <link href="/css/bootstrap.css" rel="stylesheet"/>
    <link href="/css/bootstrap-datepicker.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/iconfont.css">
    <link rel="stylesheet" href="/css/setfont.css">
  </head>
  <body style="background-color: bisque;">
    <div class="container" >
      <div class="row">
        <div class="col-xs-12 col-lg-8 col-lg-offset-2">
          <h2 >修改记录</h2>
          <h1 class="addlist" >
          <a href="/logout"><span class="iconfont icon-wode"></span></a>
          <a href="/booklist/create"><span class="iconfont icon-tianjia"></span></a>
          <a href="/booklist"><span class="iconfont icon-shouye"></span></a>
          <a href="/booklist/search"><span class="iconfont icon-sousuo"></span></a>
          
        </h1>
        </div>
        
          <hr />
          <form method="post" action="/booklist/set/<%= booklists.id%> ">
            <div class="form-group">
              <label for="item">书籍名称</label>
              <input
                name="title"
                type="text"
                class="form-control"
                id="item"
                value="<%=booklists.title%>"
              />
            </div>
            
            <div class="form-group">
              <label for="time">发布时间</label>
              <input
                name="time"
                type="text"
                class="form-control"
                id="time"
                value="<%=booklists.time%>"
              />
            </div>
            <div class="form-group">
              <label for="type">类型</label>
              <select name="type" value="<%=booklists.type%>" class="form-control" id="type">
                <option value="1">文学类</option>
                <option value="2">历史类</option>
                <option value="3">文化类</option>
                <option value="4">生活类</option>
                <option value="5">科学类</option>
              </select>
            </div>
            <div class="form-group">
              <label for="account">金额</label>
              <input
                name="account"
                type="text"
                class="form-control"
                id="account"
                value="<%=booklists.account%>"
              />
            </div>
            
            <div class="form-group">
              <label for="remarks">简介描述</label>
              <textarea name="remarks" value="<%=booklists.remarks%>" class="form-control" id="remarks"><%=booklists.remarks%></textarea>
            </div>
            <hr>
            <button type="submit" class="btn btn-primary btn-block">修改</button>
          </form>
        </div>
      </div>
    </div>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/bootstrap-datepicker.min.js"></script>
    <script src="/js/bootstrap-datepicker.zh-CN.min.js"></script>
    <script src="/js/main.js"></script>
  </body>
  <script>
    //获取所有的 delBtn
    let delBtns = document.querySelectorAll('.btn');
  
    //绑定事件
    delBtns.forEach(item => {
      item.addEventListener('click', function (e) {
        if (confirm('您确定要添改该书籍吗?')) {
          return true;
        } else {
          //阻止默认行为
          e.preventDefault();
        }
      });
    })
  </script>
</html>
